import time

def sort(file_name):
    t = time.time()
    arr = []

    with open(file_name) as f:
        for line in f:
            arr.append([int(i) for i in line.split()])

    for i in range(len(arr)):
        for j in range(0, len(arr) - 1):
            if arr[j] > arr[j + 1]:
                arr[j], arr[j + 1] = arr[j + 1], arr[j]

    t2 = time.time()
    print(arr)
    print("Time sorted by:", t2 - t)

print("Array 1")
sort('m1_sorted.txt')

print("\nArray 2")
sort('m2_reverse.txt')

print("\nArray 3\n")
sort('m3_shuffle.txt')
